home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / System / BoingBag1 / Contributions / Workbench / RexxArpLib3p6 / rexx / MouseTest.rexx < prev    next >
OS/2 REXX Batch file  |  1998-06-26  |  2KB  |  95 lines

  1. /*
  2.  *        MouseTest.rexx
  3.  *            Script for testing rexxarplib.library mouse port usages.
  4.  *
  5.  */
  6.  
  7. MouseTest:
  8.  
  9.     options results
  10.     options failat 200
  11.     debugging = 0                        /* set if we want debug messages */
  12.  
  13.     say "All test screens are named 'MNS'. If one is left open the following command:"
  14.     say 'rx "call closescreen(''MSN'')"'
  15.     say
  16.     /*
  17.      *  Set up a host
  18.      */
  19.     say
  20.     say
  21.     say "Setting up for access to the correct screen."
  22.     say "Test window should open on the new screen."
  23.     say
  24.  
  25.     pubscreen = 'MNS'
  26.     /* Screen pen indices */
  27.     /* 1 = screen title text         default = 1 */
  28.     /* 2 = screen title background  default = 2 */
  29.     /* 3 = gadget text                default = 1 */
  30.     /* 4 = highlights                default = 2 */
  31.     /* 5 = shadows                    default = 1 */
  32.     /* 6 = active window highlight    default = 3 */
  33.     /* 7 = active window text        default = 1 */
  34.     /* 8 = screen background        always  = 0 */
  35.     /* 9 = Highlight Text Pen        default = 1 */
  36.                                                                         /*  123456789 */
  37.     call OpenScreen( 0, 2, 'HIRES LACE OVERSCAN', 'My new screen!', 'MNS', '121213101', 724, 482, 0 )
  38.  
  39.     address arexx "'x = CreateHost(TESTSTUFF, TESTSTUFF_PORT, "pubscreen")'"
  40.     /*
  41.      *  Wait until it is ready. It times out after a while, so do
  42.      *    a few of them.  May not be necessary, try it on your system
  43.      *    for best results.
  44.      */
  45.     WaitForPort TESTSTUFF
  46.     WaitForPort TESTSTUFF
  47.     WaitForPort TESTSTUFF
  48.  
  49.     /*
  50.      *  Open the window
  51.      */
  52.  
  53.  
  54.     idcmp = 'CLOSEWINDOW+GADGETUP+MOUSEBUTTONS+MOUSEMOVE'
  55.     flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+BACKFILL+RESIZE+REPORTMOUSE'
  56.     /* Open the window full size for a test... */
  57.     call OpenWindow(TESTSTUFF, 0, 0, 0, 0, idcmp, flags, "MouseTest Window")
  58.  
  59.     call ModifyHost(TESTSTUFF, MOUSEBUTTONS, "%l\%x %y %b %t")
  60.     call ModifyHost(TESTSTUFF, MOUSEMOVE, "%l\%x %y %b %t")
  61.  
  62.     quitflag = 0
  63.     mp = openport(TESTSTUFF_PORT)
  64.  
  65.     do forever
  66.         if quitflag = 1 then leave
  67.         t = waitpkt(TESTSTUFF_PORT)
  68.  
  69.  
  70.         do forever
  71.             p = getpkt(TESTSTUFF_PORT)
  72.             if c2d(p) = 0 then leave
  73.  
  74.             arg = getarg(p)
  75.             t = reply( p, 0 )
  76.  
  77.             if arg = 'CLOSEWINDOW' then
  78.             do
  79.                 call CloseWindow(TESTSTUFF)
  80.                 quitflag = 1
  81.             end
  82.             else
  83.             do
  84.                 say arg
  85.                 call WindowText( TESTSTUFF, arg)
  86.             end
  87.         end
  88.         say "outerloop"
  89.     end
  90.     say "outathere"
  91.     call CloseScreen( "MNS" )
  92.     say "exiting"
  93. exit
  94.  
  95.